using System;
using System.Collections.Generic;
using System.Text;

namespace Tests.sbMembership
{
    public class TestUtils
    {
        public string RandomString(int maxSize)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            char ch;
            int size = Convert.ToInt32(Math.Truncate(random.NextDouble() * maxSize + 1));
            for (int i = 0; i < size; i++)
            {
                if (i == 0)
                    ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
                else
                    ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 97)));
                builder.Append(ch);
            }

            return builder.ToString();
        }
    }
}
